/*
 * seqFeederV.h
 *
 *  Created on: 2011-09-03
 *      Author: pawel
 */

#ifndef SEQFEEDERV_H_
#define SEQFEEDERV_H_
#include <pthread.h>
#include<boost/unordered_map.hpp>

#include"Params/SeqAlignParams.h"

//TODO add reverse file-list feeder class
namespace bpp{
class BasicSequence;
}
//class seqAlignParams;
/*
 * Viurtual class seqFeeder provides consumer - producer interface for fetching
 * sequences
 *
 *  */
class seqFeeder{
protected:
	/*
	 *Use this variables to implement producer - consumer buffer
	 *
	 */
	pthread_mutex_t *mutex;
	pthread_cond_t *notFull, *notEmpty;
	bool full,empty,closed,productionEnded;
	boost::unordered_map<std::string,seqAlignParams> optionalParams;

public:
	seqFeeder();
	virtual ~seqFeeder()=0;
	bool isFull()const;
	bool isEmpty()const;
	bool isClosed()const;
	bool isProductionEnded()const;
	void setClose();
	void endProduction();
	pthread_mutex_t* getMutex()const;
	pthread_cond_t*  getNotFull()const;
	pthread_cond_t*  getNotEmpty()const;
	virtual bpp::BasicSequence* getSeq()=0;
	virtual void pushSeq(bpp::BasicSequence*)=0;
	virtual void pushAddParams(seqAlignParams *params,std::string seqName)=0;
	virtual seqAlignParams* getAddParam(std::string seqName)=0;


};


#endif /* SEQFEEDERV_H_ */
